﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Lonewolf.Entity;
using Lonewolf.Infrastructure;
using Lonewolf.IService;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Mvc;

namespace Lonewolf.WebApp.Controllers
{
    public class AdminController : Controller
    {
        private IAdminInfoService adminInfo;
        public AdminController(IAdminInfoService adminInfo)
        {
            this.adminInfo = adminInfo;
        }
        public IActionResult Index()
        {
            return Content("");
        }
        [HttpPost, HttpGet]
        public async Task<JsonResult<SaveEntity>> Save()
        {
            AdminInfo admin = new AdminInfo()
            {
                Id = "b5fe77f62e7f476097f97dc8738003ce",
                LoginName = "hanzuxiang",
                IsUse = true
            };
            string pwd = "670b14728ad9902aecba32e22fa4f6bd";
            string roleIds = "asd123,qwe123,58gg";
            return await adminInfo.SaveAsync(admin, pwd, roleIds);
        }
    }
}